Skip to content

feat: auto failover APIs with LK Cloud#686

Open
davidzhao wants to merge 6 commits into
mainfrom
dz/region-failover
Open

feat: auto failover APIs with LK Cloud#686
davidzhao wants to merge 6 commits into
mainfrom
dz/region-failover

Conversation

@davidzhao

Copy link
Copy Markdown
Member

retries in alternative datacenters on 5xx and transport failures

also removed legacy camel-case, which was not needed since we switched to protobuf-es

retries in alternative datacenters on 5xx and transport failures
@davidzhao davidzhao requested review from anunaym14 and lukasIO June 27, 2026 21:42
@changeset-bot

changeset-bot Bot commented Jun 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e6ef3f7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
livekit-server-sdk Patch
agent-dispatch Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@davidzhao davidzhao requested a review from 1egoman June 27, 2026 21:42
Add auto failover APIs for LK Cloud in livekit-server-sdk.
@davidzhao

Copy link
Copy Markdown
Member Author

CI depends on livekit/livekit#4627

devin-ai-integration[bot]

This comment was marked as resolved.

return { origins, ttl };
}

function parseMaxAge(cacheControl: string | null): number {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: would be nice to have some unit tests for this (can add this in a follow up)

* cached list when available, otherwise an empty list. Forwards `headers` so a
* valid token — and any test directives — reach the discovery endpoint.
*/
export async function regionOrigins(origin: URL, headers: unknown): Promise<string[]> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be worth wrapping this in a origin keyed mutex so that we ensure only one regionOrigins request is processed at a time.

For the ones that are queued up afterwards they should be resolved immediately after as long as there's at least some ttl set for the cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants